home *** CD-ROM | disk | FTP | other *** search
/ Aminet 4 / Aminet 4 - November 1994.iso / aminet / comm / cnet / cn305c_2.lha / support / FidoNet / Method2.examples / TrapCall.REXX next >
OS/2 REXX Batch file  |  1994-01-04  |  1KB  |  75 lines

  1. /* TrapCall v1.04 11-20-93 */
  2.  
  3. /*
  4.     A sample AREXX script that can be launched as a CNet event to have
  5.     TrapDoor call your FidoNet host system.
  6. */
  7.  
  8.  Options Results
  9.  addlib('rexxsupport.library',0,-30,0)
  10.  Address "TrapDoor"
  11.  
  12.  tries=0
  13.  say ''
  14.  say 'Attempting to call Fido HOST...'
  15.  say ''
  16.  
  17.  CLEARLOOP:
  18.    tries=tries+1
  19.    if tries=10 then do
  20.      say ''
  21.      say 'ABORTING.  Unable to command TrapDoor at this time.'
  22.      say ''
  23.      Exit
  24.    End
  25.  
  26.    call Delay(250)
  27.  
  28.    '@Status S'
  29.    If Result~='IDLE' Then do
  30.      say 'STATUS:' result||'; Trapdoor busy, trying again...'
  31.      call CLEARLOOP
  32.    End
  33.  
  34. /*
  35.    At this point I like to put a command to backup the contents of my
  36.    Inbound and Outbound directories, just to be safe.  Of course that
  37.    is not too practical on a high volume regional hub system tossing
  38.    mondo megabytes every day.  :=)
  39. */
  40.  
  41.  HOST='1:2410/215.0'   /*  Fill in your OWN host's address here!!  */
  42.  tries=0
  43.  
  44. CALLHOST:
  45.   tries=tries+1
  46.   if tries=99 then do
  47.     say ''
  48.     say 'Host connection FAILED!'
  49.     say ''
  50.     exit
  51.   End
  52.   call DOIT
  53.   call CALLHOST
  54.  
  55. DOIT:
  56.   Say 'Clearing Line...'
  57.   'sclear'
  58.   Say 'Line Cleared, Calling...'
  59.   'CALL '||HOST
  60.   'STATUS D'
  61.   if Result='RESULT'Then do
  62.     Say 'Break or FQFA error'
  63.     Exit
  64.   End
  65.   if Left(Result,7)='CONNECT' Then Do
  66.     say ''
  67.     say 'Host session successful!'
  68.     say ''
  69.     Exit RC
  70.   End
  71.   Say Result
  72.   'reset'
  73.   Return
  74.  
  75.